﻿<UserControl x:Class="Hisaab.Client.Modules.Core.Management.View.BackupView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:h="clr-namespace:Hisaab.Client.Common.Helpers;assembly=Hisaab.Client.Common"
             xmlns:ribbon="clr-namespace:Fluent;assembly=Fluent" Style="{DynamicResource BackStageControl}"
             mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="604" d:DesignWidth="822">
    <ScrollViewer>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="500" />
        </Grid.ColumnDefinitions>

        <StackPanel >
            <!-- Import-->
            <StackPanel Orientation="Horizontal">
                <Image Height="47" VerticalAlignment="Center" Stretch="None" Width="42" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Import.png"  />
                <Label Content="Restore" VerticalContentAlignment="Center" Style="{DynamicResource BackstageLabelBig}"  />
            </StackPanel>

            <Label Content="Select backup file to restore" Style="{DynamicResource BackstageLabel}" Padding="5,30,5,5" />
            <Image Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/dottedline.png" Stretch="None" HorizontalAlignment="Left" VerticalAlignment="Center" />
            <TextBox VerticalAlignment="Top" Height="24" HorizontalAlignment="Stretch" Text="{Binding ImportFilePath, UpdateSourceTrigger=PropertyChanged}" />
            <ribbon:Button HorizontalAlignment="Right" VerticalAlignment="Stretch" Height="24" Style="{DynamicResource ButtonBackstageStyleSmall}" Command="{Binding ImportBrowseCommand}" Width="120"
                           Icon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/open.png">Browse</ribbon:Button>

            <Label Content="Password for file" Style="{DynamicResource BackstageLabel}" />

            <PasswordBox HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="24" h:PasswordHelper.Password="{Binding ImportPassword, Mode=TwoWay}"/>
            <ribbon:Button Style="{DynamicResource ButtonBackstageStyle}" Command="{Binding ImportCommand}"
                       LargeIcon="Pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Import.png" HorizontalAlignment="Left">Import</ribbon:Button>

            <!-- Export-->
            <StackPanel Orientation="Horizontal" Margin="0,20,0,20">
                <Image Height="47" VerticalAlignment="Center" Stretch="None" Width="42" Source="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Export.png"  />
                <Label Content="Backup" VerticalContentAlignment="Center" Style="{DynamicResource BackstageLabelBig}"  />
            </StackPanel>

            <Label Content="Select file to backup to" Style="{DynamicResource BackstageLabel}" />
            <TextBox VerticalAlignment="Top" Height="24" HorizontalAlignment="Stretch" Text="{Binding ExportFilePath, UpdateSourceTrigger=PropertyChanged}" />
            <ribbon:Button HorizontalAlignment="Right" Height="24" Style="{DynamicResource ButtonBackstageStyleSmall}" Command="{Binding ExportBrowseCommand}"
                       Icon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/16/open.png" Width="140">Select File</ribbon:Button>

            <Label Content="Password to protect the backup file" Style="{DynamicResource BackstageLabel}" />
            <PasswordBox  Height="24" h:PasswordHelper.Attach="True" h:PasswordHelper.Password="{Binding ExportPassword, Mode=TwoWay}"/>
            <ribbon:Button Style="{DynamicResource ButtonBackstageStyle}" HorizontalAlignment="Left"
                       LargeIcon="pack://application:,,,/Hisaab.Client.Common;component/Resources/Images/32/Export.png" Command="{Binding ExportCommand}" Margin="0,20,0,0">Export
            </ribbon:Button>
        </StackPanel>
    </Grid>
    </ScrollViewer>
</UserControl>